package acwing._2LanQiao.test;
/**
 * @Project : AlgorithmLearning
 * @Package : ACWing._2LanQiao.test
 * @File : baseConversion.java
 * @Author : WangRuoyu
 * @Date : 2023/4/7 16:59
 */

import java.io.*;

public class baseConversion {
    static int tenTox(int n, int x) { // 十进制转x进制
        int res = 0;
        int tmp = 1;
        while (n != 0) {
            int p = n % x;
            n /= x;
            res += tmp * p;
            tmp *= 10;
        }
        return res;
    }

    static int xToTen(int n, int x) { // x进制转10进制
        int res = 0;
        int tmp = 1;
        while (n != 0) {
            int p = n % 10;
            n /= 10;
            res += tmp * p;
            tmp *= x;
        }
        return res;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = 110001;
        System.out.println(tenTox(xToTen(n, 2), 7));
    }
}
